<template>
	<view class="main">
		<view class="web-view">
			<web-view src="http://www.wendaniu.com"></web-view>
		</view>
		<Nav></Nav>
	</view>
</template>

<script>
	import Nav from "@/components/Nav.vue"
	export default {
		components:{
			Nav
		},
		data() {
			return {
				
			}
		},
		onLoad() {
			// #ifdef APP-PLUS
			let height=0;//定义动态的高度变量，如高度为定值，可以直接写
			uni.getSystemInfo({
			//成功获取的回调函数，返回值为系统信息
			success: (sysinfo) => {
				height = sysinfo.windowHeight-55;
			},
			});
			let currentWebview = this.$scope.$getAppWebview();//获取当前web-view
			
			setTimeout(()=>{
				let wv = currentWebview.children()[0];
				wv.setStyle({//设置web-view距离顶部的距离以及自己的高度，单位为px
					top: 64,
					height:height
				})
			},100)
			//#endif
		},
		onShow() {
			
		},
		methods: {

		}
	}
</script>

<style lang="scss" scoped>
	.main{
		.web-view{
			height: calc(100vh - 100rpx);
		}
	}
	
</style>
